﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using yafc.Interface;

namespace yafc
{
	public class Plugin
	{
		static private Dictionary<string, IPlugin> plugins = new Dictionary<string, IPlugin>();

		private Plugin()
		{}

		static public void Add(IPlugin value)
		{
			plugins.Add(value.Name, value);
		}
		static public bool Contains(string Name)
		{
			return plugins.ContainsKey(Name);
		}
		static public void Remove(string Name)
		{
			plugins.Remove(Name);
		}
		static public bool TryGet(string Name, out IPlugin value)
		{
			return plugins.TryGetValue(Name, out value);
		}
		static public ICollection<IPlugin> Values()
		{
			return plugins.Values;
		}
	}
}
